package com.teng.mylibrary.widget

import android.content.Context
import android.media.MediaPlayer
import android.util.AttributeSet
import android.view.KeyEvent
import android.widget.VideoView

/**
 * Description:  背景墙
 * Author:       liuteng
 * CreateDate:   2021/11/1 17:07
 * UpdateRemark: 更新说明
 */
class CustomVideoView(context:Context,attributeSet: AttributeSet) : VideoView(context,attributeSet) {

    override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
        val width = getDefaultSize(0, widthMeasureSpec)
        val height = getDefaultSize(0, heightMeasureSpec)
        setMeasuredDimension(width, height)
    }

    override fun setOnPreparedListener(l: MediaPlayer.OnPreparedListener?) {
        super.setOnPreparedListener(l)
    }

    override fun onKeyDown(keyCode: Int, event: KeyEvent?): Boolean {
        return super.onKeyDown(keyCode, event)
    }
}